package ch8.ex4;

import static ch8.print.Print.*;

public class AbstractBase {
	public static void test1(NoMethods nm){
		((Extended1)nm).f();
	}
	public static void test2(WithMethods wm){
		wm.f();
	}
	public static void main(String... args){
		NoMethods nm = new Extended1();
		test1(nm);
		WithMethods wm = new Extended();
		test2(wm);
	}
}

abstract class NoMethods{}

class Extended1 extends NoMethods{
	public void f(){
		println("TestExtend1");
	}
}

abstract class WithMethods{
	abstract public void f();
}

class Extended extends WithMethods{

	public void f() {
		println("TestExtend2");
	}
}